<template>
  <!-- 商品附带图片信息 -->
  <div class="img-from-goods-attr" v-if="imgFromGoodsAttr.open_status == 1">
    <p class="img_desc">{{imgFromGoodsAttr.desc}}</p>
    <img :src="imgFromGoodsAttr.img" :show-menu-by-longpress="true" />
  </div> 
</template>

<script>
import { getOrderImage } from '@/api/order/order.js'
export default {
  props: {
    orderId: {
      default: ''
    }
  },
  data() {
    return {
      imgFromGoodsAttr: {}
    }
  },
  mounted() {
    this.orderImage()
  },
  methods: {
    // 商品附带图片
    orderImage() {
      const data = {
        id: this.orderId
      }
      getOrderImage(data).then(res => {
        if (res.status == 1) {
          this.imgFromGoodsAttr = res.data
        } else {
          this.$Error(res.msg)
        }
      })
    }
  }
}
</script>

<style lang="scss">
.img-from-goods-attr{
  margin-top: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
  // background: #fff;
  text-align: center;
  img {
    width: 500px;
  }
  .img_desc {
    font-size: 30px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
  }
}
</style>